import sjsbApi from '../api/yjzh/sjsb.js'
export default {
	async getTypeJson() {
		let json = uni.getStorageSync('eventTypeJson')
		if (json) {
			return json
		}
		json = await sjsbApi.getJson('/data/json/eventTypeJson.json?t=' + new Date().getTime())
		uni.setStorageSync('eventTypeJson', json)
		return json
	},
	async findLevel(value) {
		const json = await this.getTypeJson()
		let LevelItem = json.evLevelList.find((el) => el.value == value)
		return LevelItem.label
	},
	async findType(value) {
		const json = await this.getTypeJson()
		let LevelItem = json.evTypeList.find((el) => el.value == value)
		return LevelItem.label
	}
}
